package algorithm.tree;

/**
 * 线过二叉树二叉链表结点类
 */
public class ThreadBinaryNode<E> {
    public E data; //数据元素
    public ThreadBinaryNode<E> left,right; //左右孩子结点
    public int ltag,rtag;//左右线索标记

    /**
     * 构造结点，指定元素和左右孩子结点
     * @param data
     * @param left
     * @param right
     */
    public ThreadBinaryNode(E data,ThreadBinaryNode<E> left, ThreadBinaryNode<E> right) {
        this.data = data;
        this.left = left;
        this.right = right;
        this.ltag = this.rtag = 0;
    }

    public ThreadBinaryNode(E data){
        this(data,null,null);
    }

    public ThreadBinaryNode() {
        this(null,null,null);
    }
}
